//JavaScript Framework 2.0 Code
try{
Type.registerNamespace('com.yonyou.dxyma.ScanController');
com.yonyou.dxyma.ScanController = function() {
    com.yonyou.dxyma.ScanController.initializeBase(this);
    this.initialize();
}
function com$yonyou$dxyma$ScanController$initialize(){
}
    
function com$yonyou$dxyma$ScanController$evaljs(js){
    eval(js)
}
function com$yonyou$dxyma$ScanController$twodimensioncode0_onscansuccess(sender, args){
    var scanString = $ctx.getString("result");
    $view.open({
        "viewid" : "com.yonyou.dxyma.Confirm",//目标页面（首字母大写）全名
        "isKeep" : "true",
        "ip" : $cache.read("ip"),
        "port" : $cache.read("port"),
        "data":confirm_data,
        "scannerData":scanString,
        "callback" : "myCallBack()"//关闭viewid页面后，执行的回调方法
    })
}
function myCallBack(){
	var num = $param.getString("num");
	$view.close({
        "resultCode": "15",//当resultCode为15时，可以响应父页面的callback
        "num": num//返回结果，result1为自定义键值
    });
}
var confirm_data;
function com$yonyou$dxyma$ScanController$viewPage0_onload(sender, args){
	var datas = $param.getJSONObject("data");
	//$alert("getdata success");
	confirm_data = datas;
		if ($param.getString("ip") == "" && $param.getString("port") == "") {
			var ip = $cache.read("ip");
			var port = $cache.read("port");
		} else {
			var ip = $param.getString("ip");
			var port = $param.getString("port");
			$cache.write("ip", ip);
			$cache.write("port", port);
		}
}
function com$yonyou$dxyma$ScanController$onkeydown(sender, args){
	$view.close({
        "resultCode": "15",//当resultCode为15时，可以响应父页面的callback
        "num": 0//返回结果，result1为自定义键值
    });
	/*$view.open({
		"viewid" : "com.yonyou.dxyma.Infos", //目标页面（首字母大写）全名
		"isKeep" : "false",
		"data" : confirm_data
	})*/
}
com.yonyou.dxyma.ScanController.prototype = {
    onkeydown : com$yonyou$dxyma$ScanController$onkeydown,
    viewPage0_onload : com$yonyou$dxyma$ScanController$viewPage0_onload,
    twodimensioncode0_onscansuccess : com$yonyou$dxyma$ScanController$twodimensioncode0_onscansuccess,
    initialize : com$yonyou$dxyma$ScanController$initialize,
    evaljs : com$yonyou$dxyma$ScanController$evaljs
};
com.yonyou.dxyma.ScanController.registerClass('com.yonyou.dxyma.ScanController',UMP.UI.Mvc.Controller);
}catch(e){$e(e);}
